<!DocType html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>test</title>
    <script>
        function eventunload()
        {
            alert("unload");

        }
        function eventLoad()
        {
            // document.getElementById("demo").innerHTML="Hello JavaScript!";
            alert("onload");
        }
        function displayResult()
        {
            var x;
            if(window.event) // IE8 及更早IE版本
            {
                x=event.keyCode;
            }
            else if(event.which) // IE9/Firefox/Chrome/Opera/Safari
            {
                x=event.which;
            }
            var keychar=String.fromCharCode(x);
            alert("按键 " + keychar + " 被按下");
        }
    </script>

</head>
<body onload="eventLoad()">

<!--<body  onunload="eventunload()">-->

<input type="text" onkeydown="displayResult()">


<!--<button onclick='document.getElementById("imgId").src = "./h5Resource2/videocall.png"'>修改图片</button>-->
<button onclick='changePic()'>修改图片</button>

<br/>

</body>
</html>